#pragma once

#include <list>
#include <map>
#include "Singleton.h"
#import <msxml6.dll>
#include <MsXml.h>

class XportItem;
class IXportItemVisitor;

class GEOMUIAPI CPlugsConfigure : 
	public ATools::TSingleton<CPlugsConfigure>
{
public:
	typedef std::list<XportItem*> XportItemList;
	CPlugsConfigure(void);
	~CPlugsConfigure(void);
	bool Load(LPTSTR szPathFile);
	void VisitExporterItem(IXportItemVisitor* pVisitor);
	void VisitImporterItem(IXportItemVisitor* pVisitor);
private:
	bool ParseXporter(const MSXML2::IXMLDOMNodePtr& pCatalogNode, XportItemList& itemList);
private:

	
	XportItemList m_Exporters;
	XportItemList m_Importers;
};

inline GEOMUIAPI CPlugsConfigure& GetCPlugsConfigure()
{
	return CPlugsConfigure::Instance();
}
//////////////////////////////////////////////////////////////////////////

class GEOMUIAPI XportItem
{
public:
	XportItem()
	{
	}
	CString szName;
	CString guid;
	CString szExt;
	CString szDesc;
	CString szDll;
	CString	szAuthor;
};

//////////////////////////////////////////////////////////////////////////

class GEOMUIAPI IXportItemVisitor
{
public:
	virtual ~IXportItemVisitor(){}
	virtual void OnVisitItem(XportItem* pItem) = 0;
};